/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package UTS.view;

import UTS.model.Surat;
import UTS.model.SuratTableModel;
import java.awt.BorderLayout;
import java.util.ArrayList;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
/**
 *
 * @author Vincentius HMK
 */
public class PanelLihatSurat extends JPanel{
private JTable tablePublikasi;
    private JLabel labelPanel;
    private ArrayList<Surat> data;

    public PanelLihatSurat(ArrayList<Surat> data) {
        this.data = data;
        setLayout(new BorderLayout());
        labelPanel = new JLabel("Form Lihat Surat");
        labelPanel.setHorizontalAlignment(JLabel.CENTER);
        add(labelPanel, BorderLayout.NORTH);
        tablePublikasi = new JTable();
        tablePublikasi.setModel(new SuratTableModel(data));
        add(tablePublikasi, BorderLayout.CENTER);
    }

    public ArrayList<Surat> getData() {
        return data;
    }

    public void setData(ArrayList<Surat> data) {
        this.data = data;
    }
}
